package com.yang.service.wximpl;

import com.yang.bean.MarketFeedback;
import com.yang.bean.MarketUser;
import com.yang.bean.zdd.bo.SubmitBo;
import com.yang.mapper.MarketFeedbackMapper;
import com.yang.service.wx.WXFeedbackService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;

/**
 * @ClassName WXFeedbackServiceImpl
 * @Description TODO
 * @Author zhangdongdong
 * @Date 2022/9/12 14:54
 * @Version 1.0
 */
@Service
public class WXFeedbackServiceImpl implements WXFeedbackService {
    @Autowired
    MarketFeedbackMapper feedbackMapper;

    @Override
    public void submit(SubmitBo submitBo, MarketUser user) {
        MarketFeedback feedback = new MarketFeedback();
        feedback.setUserId(user.getId());
        feedback.setUsername(user.getUsername());
        feedback.setMobile(submitBo.getMobile());
        feedback.setFeedType(submitBo.getFeedType());
        feedback.setContent(submitBo.getContent());
        feedback.setHasPicture(submitBo.getHasPicture());
        feedback.setPicUrls(submitBo.getPicUrls());
        feedback.setAddTime(new Date());
        feedback.setUpdateTime(new Date());
        feedback.setDeleted(false);
        feedbackMapper.insertSelective(feedback);
    }
}
